<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('menus', function (Blueprint $table) {
            $table->id();
            $table->integer('parent_id')->comment('父菜单ID');
            $table->string('label')->comment('菜单名称');
            $table->integer('sort')->default(999)->comment('菜单排序');
            $table->string('icon')->nullable()->comment('菜单图标');
            $table->string('router_name')->nullable()->comment('路由名称');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('menus');
    }
};
